org.eclipse.vtp.framework.common
Interface IVariableRegistry

All Known Implementing Classes:
VariableRegistry

public interface IVariableRegistry

A service that manages a collection of named data variables.

Author:
Lonnie Pryor

Method Summary
 void clearVariable(java.lang.String name)
          Removes the registration of the variable under the specified name
 IDataObject createVariable(IDataType type)
          Creates a new variable of the specified type.
 IDataObject createVariable(java.lang.String typeName)
          Creates a new variable of the specified type.
 IDataObject getVariable(java.lang.String name)
          Returns the variable registered under the specified name or null if no such variable is registered.
 java.lang.String[] getVariableNames()
          Returns the names of all the variables currently registered.
 void setVariable(java.lang.String name, IDataObject variable)
          Registers a variable under the specified name, removing any variable previously registered under that name.
 

Method Detail

createVariable

IDataObject createVariable(java.lang.String typeName)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.NullPointerException
Creates a new variable of the specified type.

Parameters:
typeName - The name of the type of variable to create.
Returns:
A new variable of the specified type.
Throws:
java.lang.IllegalArgumentException - If no type with the specified name exists.
java.lang.NullPointerException - If the supplied type name is null.

createVariable

IDataObject createVariable(IDataType type)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.NullPointerException
Creates a new variable of the specified type.

Parameters:
type - The type of variable to create.
Returns:
A new variable of the specified type.
Throws:
java.lang.NullPointerException - If the supplied type is null.
java.lang.IllegalArgumentException

getVariableNames

java.lang.String[] getVariableNames()
Returns the names of all the variables currently registered.

Returns:
The names of all the variables currently registered.

getVariable

IDataObject getVariable(java.lang.String name)
                        throws java.lang.NullPointerException
Returns the variable registered under the specified name or null if no such variable is registered.

Parameters:
name - The name of the variable to return.
Returns:
The variable registered under the specified name or null if no such variable is registered.
Throws:
java.lang.NullPointerException - If the supplied variable name is null.

setVariable

void setVariable(java.lang.String name,
                 IDataObject variable)
                 throws java.lang.IllegalArgumentException,
                        java.lang.NullPointerException
Registers a variable under the specified name, removing any variable previously registered under that name.

Parameters:
name - The name to register the variable under.
Throws:
java.lang.IllegalArgumentException - If the supplied variable was not created by this registry.
java.lang.NullPointerException - If the supplied variable name is null.
java.lang.NullPointerException - If the supplied variable is null.

clearVariable

void clearVariable(java.lang.String name)
                   throws java.lang.NullPointerException
Removes the registration of the variable under the specified name

Parameters:
name - The name of the variable to clear.
Throws:
java.lang.NullPointerException - If the supplied variable name is null.